<template>
  <div class='infomationDetails'>
    <div class='details'>
      <h3>{{title}}</h3>
      <p>
        <span>{{time}}</span>.
        <span>{{from}}</span>
      </p>
      <div>
        <div class='content' v-html='content'>

        </div>
      </div>
    </div>

  </div>
</template>


<script>
  import {ajax} from '@/api';
  import {parseTime, formatTime} from '@/utils';

  export default {
    name: 'infomationDetails',
    data() {
      return {
        params: {
          targetId: ''
        },
        bigImg: '',
        title: '',
        content: '',
        from: '',
        time: '正在读取数据...'
      }
    },
    method: {
    },
    mounted() {
      //this.getNewDetails();
      document.title = '视纪影视';
      this.params.targetId = this.$route.params.id;
      ajax('newsDetail', this.params).then((data) => {
        let json = data.data;
        if (json.status) {
          console.log(json);
          if (json.data.info.bigCoverImage) {
            this.bigImg = json.data.info.bigCoverImage;
          }

          this.title = json.data.info.title;
          this.time = formatTime(json.data.createTime);
          this.from = json.data.info.source;
          this.content = json.data.info.content;
        }
      });
    }

  }
</script>


<style lang="less">
  .infomationDetails {
    .details {
      padding: 1rem .6rem;
      h3 {
        margin: 0;
        font-weight: 400;
        font-size: 24px;
        color: #333;
        line-height: 2rem;
      }
      > p {
        color: #999;
        font-size: 12px;
        margin: .6rem 0 0 0;
      }
      .content{
          margin-top: 50px;
          img{
              width: 100%;
          }
          p{
            font-size: 16px;
            line-height: 1.6rem;
            color: #5e5e5e;
            margin-bottom: 33px;
          }
          strong{
            font-weight: bold;
          }
      }
    }
  }
</style>
